Skip to content

fix: run error hook when provider returns error code#951

Merged
beeme1mr merged 3 commits into
open-feature:mainfrom
jarebudev:bugfix/928_error_hooks_only_run_if_provider_throws
May 30, 2024
Merged

fix: run error hook when provider returns error code#951
beeme1mr merged 3 commits into
open-feature:mainfrom
jarebudev:bugfix/928_error_hooks_only_run_if_provider_throws

Conversation

@jarebudev

Copy link
Copy Markdown
Contributor

This PR

  • ensures that the error hook is ran when the provider returns an error code

Related Issues

Fixes #928

Notes

saw this bug and seemed like a straightforward fix, wasn't sure if anyone has already picked it up so feel free to reject if it's already been taken on

@jarebudev jarebudev requested a review from a team as a code owner May 23, 2024 22:48
@codecov

codecov Bot commented May 23, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.26%. Comparing base (27c9114) to head (380b177).

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #951      +/-   ##
============================================
+ Coverage     94.98%   95.26%   +0.28%     
- Complexity      383      392       +9     
============================================
  Files            36       37       +1     
  Lines           877      887      +10     
  Branches         53       54       +1     
============================================
+ Hits            833      845      +12     
+ Misses           24       23       -1     
+ Partials         20       19       -1     
Flag Coverage Δ
unittests 95.26% <100.00%> (+0.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread src/main/java/dev/openfeature/sdk/internal/ErrorUtils.java Outdated
@Kavindu-Dodan Kavindu-Dodan force-pushed the bugfix/928_error_hooks_only_run_if_provider_throws branch from 0f197a0 to 06b7ad2 Compare May 24, 2024 18:28
@Kavindu-Dodan

Copy link
Copy Markdown
Contributor

I have this suggestion, otherwise looks good :)

@Kavindu-Dodan Kavindu-Dodan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jarebudev Nice work 🙌

@Kavindu-Dodan Kavindu-Dodan added this to the 1.8.1 milestone May 24, 2024
Comment thread src/main/java/dev/openfeature/sdk/OpenFeatureClient.java Outdated
@Kavindu-Dodan Kavindu-Dodan force-pushed the bugfix/928_error_hooks_only_run_if_provider_throws branch from 3129001 to 5769409 Compare May 28, 2024 22:14
jarebudev and others added 3 commits May 30, 2024 11:30
Signed-off-by: jarebudev <23311805+jarebudev@users.noreply.github.com>
Signed-off-by: jarebudev <23311805+jarebudev@users.noreply.github.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
@Kavindu-Dodan Kavindu-Dodan force-pushed the bugfix/928_error_hooks_only_run_if_provider_throws branch from 5769409 to 380b177 Compare May 30, 2024 18:30
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@toddbaert toddbaert self-requested a review May 30, 2024 18:36
@beeme1mr beeme1mr merged commit dbfeb72 into open-feature:main May 30, 2024
@jarebudev jarebudev deleted the bugfix/928_error_hooks_only_run_if_provider_throws branch June 11, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Error hooks only run if the provider throws

4 participants